package com.dks.repository.impl.publicCompoment;

import com.dks.enumeration.DictionaryType;
import com.dks.mapper.PublicDictionaryMapper;
import com.dks.models.publicCompoment.PublicDictionary;
import com.dks.repository.IPublicDictionaryRepository;
import com.dks.result.Result;
import com.dks.result.ResultInfo;
import com.dks.result.ResultModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class PublicDictionaryRepository implements IPublicDictionaryRepository {

    @Autowired
    private PublicDictionaryMapper publicDictionaryMapper;

    @Override
    public ResultModel<List<PublicDictionary>> getByType(DictionaryType dictionaryType) {
        return Result.makeResult(ResultInfo.SUCCESS, publicDictionaryMapper.getByType(dictionaryType.name()));
    }
}
